#pragma once
#include "CWindow/CDialogBase.h"
#include "CDlgSplit.h"
#include "CDlgCombine.h"
#include <vector>

class CDlgTableFrame
	:
	public CDialogBase
{
public:

	dlg_msg LRESULT OnInitDialog(WPARAM wParam, LPARAM lParam);
	dlg_msg LRESULT OnClose(WPARAM wParam, LPARAM lParam);
	dlg_msg LRESULT OnTaskBarCreated(WPARAM wParam, LPARAM lParam);
	dlg_msg LRESULT OnTrayIcon(WPARAM wParam, LPARAM lParam);
	dlg_msg LRESULT OnColor(WPARAM wParam, LPARAM lParam);

	dlg_notify LRESULT OnTabSelChanging(WORD wID, LPNMHDR pNmhdr);
	dlg_notify LRESULT OnTabSelChange(WORD wID, LPNMHDR pNmhdr);

	dlg_command LRESULT OnExit(WORD wNotify, WORD wID, HWND hWnd);
	dlg_command LRESULT OnTopmost(WORD wNotify, WORD wID, HWND hWnd);
	dlg_command LRESULT OnShow(WORD wNotify, WORD wID, HWND hWnd);
	dlg_command LRESULT OnHide(WORD wNotify, WORD wID, HWND hWnd);
	dlg_command LRESULT OnAbout(WORD wNotify, WORD wID, HWND hWnd);

	dlg_msg LRESULT OnLanguageChange(WPARAM wParam, LPARAM lParam);
	dlg_command LRESULT OnLang_zh_cn(WORD wNotify, WORD wID, HWND hWnd);
	dlg_command LRESULT OnLang_en_US(WORD wNotify, WORD wID, HWND hWnd);
public:

	virtual BOOL DialogMessage(LPMSG pMsg);
	virtual BOOL PreTranslateMessage(LPMSG pMsg);

private:

	void ShowTrayIcon();
	VOID CreatePopMenu(int xPos, int yPos, bool isTop);
	bool ShowForeground(HWND hWnd);

private:
	DECLARE_DLG_MESSAGE_MAP()

	std::vector<CDialogBase*> m_SubWnd;
	CAboutDialog m_aboutDlg;
	LANGID m_langID = 0;
	HWND m_hHideWnd = NULL;
	HMENU m_hMainMenu = NULL;
	HMENU m_hPopMenu = NULL;
	HBRUSH m_hBrush = NULL;
};
